import { axios } from '@/utils/request'

export function getUserPage(parameter) {
  return axios({
    url: '/user/page',
    method: 'get',
    params: parameter,
  })
}

export function addUser(parameter) {
  return axios({
    url: '/user/add',
    method: 'post',
    data: parameter,
  })
}

export function userEdit(parameter) {
  return axios({
    url: '/user/edit',
    method: 'post',
    data: parameter,
  })
}

export function userDetail(parameter) {
  return axios({
    url: '/user/detail',
    method: 'get',
    params: parameter,
  })
}

export function userDelete(parameter) {
  return axios({
    url: '/user/delete',
    method: 'post',
    data: parameter,
  })
}

export function userOwnRole(parameter) {
  return axios({
    url: '/user/ownRole',
    method: 'get',
    params: parameter,
  })
}

export function userGrantRole(parameter) {
  return axios({
    url: '/user/grantRole',
    method: 'post',
    data: parameter,
  })
}

export function userOwnData(parameter) {
  return axios({
    url: '/user/ownData',
    method: 'get',
    params: parameter,
  })
}

export function userGrantData(parameter) {
  return axios({
    url: '/user/grantData',
    method: 'post',
    data: parameter,
  })
}

export function userUpdatePwd(parameter) {
  return axios({
    url: '/user/updatePwd',
    method: 'post',
    data: parameter,
  })
}

export function userChangeStatus(parameter) {
  return axios({
    url: '/user/changeStatus',
    method: 'post',
    data: parameter,
  })
}

export function userResetPwd(parameter) {
  return axios({
    url: '/user/resetPwd',
    method: 'post',
    data: parameter,
  })
}

export function userSelector(parameter) {
  return axios({
    url: '/user/selector',
    method: 'get',
    params: parameter,
  })
}
